// Location.cpp
//
// Created By: Jeremy Butler
// Created On: 31-Mar-2011

#include "Location.h"
using namespace std;

Location::Location() : x(0), y(0) {
  return;
}

Location::Location(const Location & other) : x(other.x), y(other.y){
  return;
}

Location::Location(int _x, int _y) : x(_x), y(_y){
  return;
}

Location::~Location(){
  return;
}

Location & Location::operator = (const Location & other){
  if(this != &other){
    x = other.x;
    y = other.y;
  }
  return *this;
}

bool Location::operator < (const Location & other) const {
  bool b = false;
  if(y < other.y)
    b = true;
  else if(y == other.y && x < other.x)
    b = true;
  return b;
}

bool Location::operator == (const Location & other) const {
  return (x == other.x && y == other.y);
}

int Location::GetX() const {
  return x;
}

int Location::GetY() const {
  return y;
}

void Location::SetX(int _x){
  x = _x;
}

void Location::SetY(int _y){
  y = _y;
}

void Location::Set(int _x, int _y){
  x = _x;
  y = _y;
}

bool Location::Equals(int _x, int _y){
  return (x == _x && y == _y);
}